package ch.fhnw.qualiscan.core.helpers;

import com.vaadin.ui.Component;
import com.vaadin.ui.Label;

/**
 * Text helper takes care of html markup like h1-h4, p, etc. Instead of creating Label with markup in them, use TextHelper
 * and it returns a Label with the right markup automatically.
 * @author Benjamin Groehbiel
 *
 */
public class TextHelper {
	
	public Label h1(String string) {
		Label title = new Label("<h1>" + string + "</h1>");
		title.setContentMode(Label.CONTENT_XHTML);
		return title;
	}
	
	public Label h2(String string) {
		Label title = new Label("<h2>" + string + "</h2>");
		title.setContentMode(Label.CONTENT_XHTML);
		return title;
	}
	
	public Label h3(String string) {
		Label title = new Label("<h3>" + string + "</h3>");
		title.setContentMode(Label.CONTENT_XHTML);
		return title;
	}
	
	public Label h4(String string) {
		Label title = new Label("<h4>" + string + "</h4>");
		title.setContentMode(Label.CONTENT_XHTML);
		return title;
	}
	
	public Label h5(String string) {
		Label title = new Label("<h5>" + string + "</h5>");
		title.setContentMode(Label.CONTENT_XHTML);
		return title;
	}
	
	public Label p(String string) {
		Label title = new Label("<p>" + string + "</p>");
		title.setContentMode(Label.CONTENT_XHTML);
		return title;
	}
	
	public Label span(String string) {
		Label title = new Label("<span>" + string + "</span>");
		title.setContentMode(Label.CONTENT_XHTML);
		title.setWidth("");
		return title;
	}

	public Label pure(String string) {
		Label title = new Label(string);
		return title;
	}

	public Label boxTitle(String string) {
		Label title = new Label(string);
		return title;
	}

	public Label strong(String strongString) {
		Label string = new Label("<strong>" + strongString + "</strong>");
		string.setContentMode(Label.CONTENT_XHTML);
		string.setWidth("");
		return string;
	}

	public Label bigSpan(String string) {
		Label title = new Label(string);
		title.setContentMode(Label.CONTENT_XHTML);
		title.setStyleName("bigSpan");
		title.setWidth("");
		return title;
	}
	
}
